<script type="text/javascript" src="<?php echo RESOURCE_PATH;?>/js/jquery.validation.min.js"></script>
<header class="layout head padding-small">
    <a href="javascript:pageBack();" class="hBack float-left"></a>
    <h4 class="hTxt float-left text-center text-white">找回密码</h4>
    <a href="javascript:;" id="btnJdkey" class="hHlep float-right"></a>
</header>
<!--找回密码S-->
<div class="margin bg-white padding radius-big">
    <!--找回密码的步骤S-->
    <div class="revise-mobile">
        <div class="step text-small">
            <!--正在那一步的添加类active  已经通过了的添加类complete-->
            <div class="step-bar active" style="width:25%;"><span class="step-point icon-check"></span><span class="step-text">账号验证</span></span></div>
            <div class="step-bar" style="width:25%;"><span class="step-point">2</span><span class="step-text">身份校验</span></div>
            <div class="step-bar" style="width:25%;"><span class="step-point">3</span><span class="step-text">新密码</span></div>
            <div class="step-bar" style="width:25%;"><span class="step-point">4</span><span class="step-text">成功</span></div>
        </div>
    </div>

	<div class="x85 padding-top">
            <form action="index.php?act=login&op=find_password_step2" method="post" id="login_form">
                <input type="hidden" name="form_submit" value="ok" />
        		<input name="nchash" type="hidden" value="<?php echo $output['nchash'];?>" /> 
                <span class="new-input-span mg-b15">
                    <input type="text" value="" class="border border-ef7f7e layout padding radius-big" name="email" id="email" placeholder="请输入账号/手机号码/邮箱">
                </span>
                <span class="new-input-span mg-b15">
                    <input type="text" value="" class="border border-ef7f7e layout padding radius-big" name="captcha" id="captcha" placeholder="请输入下面的验证码" maxlength="4">
                </span>
                <div style="margin-bottom:10px; height:40px;">
                	<img src="index.php?act=seccode&op=makecode&nchash=<?php echo $output['nchash'];?>" name="codeimage" border="0" id="codeimage" class="border-none float-left " />
                    <a href="javascript:void(0)" onclick="javascript:document.getElementById('codeimage').src='index.php?act=seccode&op=makecode&nchash=<?php echo $output['nchash'];?>&t=' + Math.random();" class="float-left padding  margin-left radius-big bg-yellow text-white">看不清，换一张</a>
                </div>
                <input type="submit" value="提交" class="border-none bg-red text-white layout padding radius-big " />
            </form>
        </div>

    </div>
<script type="text/javascript">
$(document).ready(function(){
	$("#login_form").validate({
        errorPlacement: function(error, element){
            var error_td = element.parent('span');
            error_td.find('label').hide();
            error_td.append(error);
        },
		rules: {
			email : {
                required : true,
                remote   : {
                    url : 'index.php?act=login&op=find_password_email_exist',
                    type: 'get',
                    data:{
                        email : function(){
                            return $('#email').val();
                        }
                    }
                }                
            }
			<?php if(C('captcha_status_login') == '1') { ?>
            ,captcha : {
                required : true,
                remote   : {
                    url : 'index.php?act=seccode&op=check&nchash=<?php echo $output['nchash'];?>',
                    type: 'get',
                    data:{
                        captcha : function(){
                            return $('#captcha').val();
                        }
                    }
                }
            }
			<?php } ?>
		},
		messages: {
            email  : {
                required : '请输入账号、手机号或邮箱地址',
                remote   : '该账号、手机号或邮箱不存在'   
            }
			<?php if(C('captcha_status_login') == '1') { ?>
            ,captcha : {
                required : '验证码不能为空',
				remote	 : '验证码输入错误'
            }
			<?php } ?>
		}
	});
});
</script>